import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);

const routes = [
  {
    path: "/login",

    name: "login",
    component: () => import("@/views/MyLogin/MyLogin.vue"),
  },
  {
    path: "/layout",
    name: "layout",
    component: () => import("@/layout/MyLayout.vue"),
    children: [
      {
        path: "dataList",
        name: "dataList",
        component: () => import("@/layout/dataList/MyDataList.vue"),
      },
      {
        path: "userList",
        name: "userList",
        component: () => import("@/layout/userList/MyUserList.vue"),
      },
      {
        path: "questionBank",
        name: "questionBank",
        component: () => import("@/layout/questionBank/MyQuestionBank.vue"),
      },
      {
        path: "enterprises",
        name: "enterprises",
        component: () => import("@/layout/enterprises/MyEnterprises.vue"),
      },
      {
        path: "subjectList",
        name: "subjectList",
        component: () => import("@/layout/subjectList/MySubjectList.vue"),
      },
    ],
  },

  {
    // 路由重定向
    path: "/",
    redirect: "/layout/dataList",
    component: () => import("@/layout/MyLayout.vue"),
  },
];

const router = new VueRouter({
  routes,
});

export default router;
